/**
 * MapParamFactory.java
 * com.sitech.dmcs.core.factory
 * Function： TODO 
 *
 *   ver  author   date    
 * ──────────────────────────────────
 *   	 geutopia  Jan 20, 2011        
 *
 * Copyright (c) 2011, TNT All Rights Reserved.
 */

package com.sitech.timing.param.impl;

import java.util.HashMap;
import java.util.Map;

import com.sitech.timing.domain.ParamType;
import com.sitech.timing.param.ParamBuilder;
import com.sitech.timing.param.ParamObjectFactoy;


/**
 * ClassName:MapParamFactory
 * Function: TODO ADD FUNCTION
 * Reason:	 TODO ADD REASON
 *
 * @author   geutopia
 * @version  
 * @since    Ver 1.1
 * @Date	 2011	Jan 20, 2011		1:32:19 PM
 *
 * @see 	 
 */

public class MapParamFactory implements ParamObjectFactoy, ParamBuilder
{

	/**
	 * (non-Javadoc)
	 * @see com.sitech.dmcs.core.param.ParamObjectFactoy#createParamObject(java.lang.String)
	 */
	public Object createParamObject(String className)
	{
		return new HashMap();
	}

	/**
	 * (non-Javadoc)
	 * @see com.sitech.dmcs.core.param.ParamBuilder#build(java.lang.Object, java.util.Map)
	 */
	public Object build(Object object, Map<String, Object> valueMap,ParamType paramType)
	{
		if (object instanceof Map)
		{
			Map newObject = (Map) object;
			newObject.putAll(valueMap);
			return newObject;
		}
		else
		{
			return object;
		}

	}

}
